//
//  SecondViewController.m
//  集成ReactNative
//
//  Created by Admin on 2017/3/6.
//  Copyright © 2017年 Admin. All rights reserved.
//

#define ColorA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0]
#define Color(r, g, b) ColorA((r), (g), (b), 255)
#define RandomColor Color(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255))

#import "SecondViewController.h"
#import <React/RCTRootView.h>

@interface SecondViewController ()

@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = RandomColor;
    NSURL *jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios"];
    RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"ReactNativeXM" initialProperties:nil launchOptions:nil];
    [self.view addSubview:rootView];
    rootView.frame = self.view.bounds;
}

@end
